def dz(m):
    s = 0
    for i in range(1, m+1):
        s += (i+1)*i//2
    return s


def main():
    n = int(input())
    for i in range(n):
        m = int(input())
        print(dz(m))


main()
